package com.xcity.game.worldevent;

import java.util.Objects;

import com.xcity.game.buff.BuffEffector;
import com.xcity.game.buff.BuffTemplate;

import naga.x.App;
import naga.x.game.template.TemplateService;

public class WorldEventBuffTemplateWrap extends BuffTemplate {

	protected WorldEventTemplate ref;
	
	public WorldEventBuffTemplateWrap(int id, int eventId) {
		this(id, App.getApp().getServiceManager().get(TemplateService.class).get(WorldEventTemplate.class, eventId));
	}
	
	public WorldEventBuffTemplateWrap(int id, WorldEventTemplate ref) {
		this.id = id;
		this.ref = Objects.requireNonNull(ref);
		this.effectId = BuffEffector.BUFF_WORLD_EVENT;
	}

	@Override
	public String getName() {
		return "世界事件";
	}

	@Override
	public String getDesc() {
		return ref.getDesc();
	}

	@Override
	public String getIcon() {
		return ref.getIcon();
	}

	@Override
	public int getDuration() {
		return ref.getDuration();
	}

	public WorldEventTemplate getRef() {
		return ref;
	}

}
